package org.come.control;

import java.util.List;

import org.come.Frame.AlreadyRecordedJframe;
import org.come.Frame.CollectionJadeJframe;
import org.come.Frame.ExchangeValueJframe;
import org.come.Jpanel.AlreadyRecordedJpanel;
import org.come.action.NpcMenuAction;
import org.come.until.FormsManagement;
import org.come.until.UserMessUntil;

import com.tool.role.RoleData;

public class ExchangeValueControl implements NpcMenuAction {

	@Override
	public void menuControl(String type) {

		if ("我要兑换灵修值".equals(type)) {// 打开兑换灵修值面板
			ExchangeValueJframe.getExchangeValueJframe().getValueJpanel().clearInterface();
			FormsManagement.showForm(63);
		} else if ("我要收录玉符（玉符转符录）".equals(type)) {// 打开收录玉符面板
			CollectionJadeJframe.getCollectionJadeJframe().getJadeJpanel().clearInterface();
			FormsManagement.showForm(64);
		} else if ("我要查看已有符录（符录转玉符）".equals(type)) {// 打开已有玉符面板
			AlreadyRecordedJframe.getAlreadyRecordedJframe().getRecordedJpanel().clearInterface();
			List<Integer> listSuit = RoleData.getRoleData().getPackRecord().accessCollect();
			AlreadyRecordedJframe.getAlreadyRecordedJframe().getRecordedJpanel().getListModel().removeAllElements();
			AlreadyRecordedJpanel.suitNum = 0;
			if (listSuit != null && listSuit.size() > 0) {
				AlreadyRecordedJpanel.suitNum = listSuit.size();
				for (int i = 0; i < listSuit.size(); i++) {
					AlreadyRecordedJframe.getAlreadyRecordedJframe().getRecordedJpanel().getListModel()
							.add(i, UserMessUntil.getAllSuit().getRolesuit().get(listSuit.get(i)).getSname());
				}
			}
			FormsManagement.showForm(65);
		}
	}
}
